//
//  LGToolMethods.h
//  GenerationOfDriving
//
//  Created by 1 on 14-10-9.
//  Copyright (c) 2014年 张文权. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface LGToolMethods : NSObject

//判断 ios设备的类型（iphone，ipod，ipad）
+(BOOL)checkDeviceTpye:(NSString*)name;


/**修改重新格式化字符串*/
+(NSString *)transformFormateDate:(NSString *)localDate withFormat:(NSString *)formate;
/**校验手机号码是否正确*/
+(BOOL)validateMobile:(NSString *)mobileNum;
//身份证
+ (BOOL) validateIdentityCard: (NSString *)identityCard;
//保存
+(BOOL)saveUserDefaultsObj:(id)obj forKey:(NSString *)key;
//获取userdefaults
+(id)getUserDefaultsObjForKey:(NSString *)key;
//移除userdefaults
+(BOOL)removeDefaultsObjForKey:(NSString *)key;
//字符串转date
+(NSDate*)dateFromString:(NSString*)dateString;
//date转字符串
+(NSString*)stringFromDate:(NSDate*)sourceDate;
//时间戳转字符串
+(NSString*)stringFromInterval:(double)interval withFormate:(NSString *)formateString;

+(NSString*)getSystemDateNow;

+(NSString*)getDateString:(NSString *)sourceDate withFormate:(NSString*)formateString;

+(void)writeFile:(NSString*)filename :(NSString*)data;

+ (NSString *)readFile:(NSString *)filename;

// 判断是否为空串
+(BOOL)isNull:(id)object;

// 转换空串
+(NSString*)convertNull:(id)object;

+(NSString *)changeUIColorToRGB:(UIColor *)color;

//判断字符串是不是空的
+(BOOL)validateStringNull:(NSString *)string;

//判断身份证的合法性
+ (BOOL)validateIDCardNumber:(NSString *)value;
/**
 *  拨打电话
 *
 *  @param number 电话号码
 */
+(void)callMobilePhone:(NSString *)number;
//设置照相属性   让头像不歪
//+ (UIImage *)fixOrientation:(UIImage *)aImage;

+ (UIImage *)createImageWithColor:(UIColor *)color;

/**
 *  对图片尺寸进行压缩
 */

+(UIImage*)imageWithImage:(UIImage*)oldImage scaledToSize:(CGSize)newSize;
//禁止输入emoji表情
+(NSString*)disable_emoji:(NSString*)text;

+(UIColor *) colorWithHexString: (NSString *) stringToConvert;


@end
